package com.mycloud.utils;

import java.time.LocalDateTime;
import java.util.Random;

/**
 * Created by PC on 2019/1/2.
 */
public class KeyUtil {

    /**
     * 生成唯一主键
     * 时间+随机数
     * @return
     */
    public static synchronized String getUniqueKey() {
        Random random = new Random();
        Integer number = random.nextInt(900000)+100000;
        return System.currentTimeMillis() + number.toString();
    }
}
